#include "bail_error_strategy.h"

namespace cyclone::parser
{
    using antlr4::InputMismatchException;
    using antlr4::RecognitionException;
    using antlr4::ParseCancellationException;
    using antlr4::ParserRuleContext;

    void BailErrorStrategy::recover(Parser *recognizer, std::exception_ptr e)
    {
        std::rethrow_exception(e);
    }

    Token *BailErrorStrategy::recoverInline(Parser *recognizer)
    {
        throw InputMismatchException(recognizer);
    }

    void BailErrorStrategy::sync(Parser *recognizer)
    {
        // Shall do nothing
    }

} // namespace cyclone::parser
